import 'package:json_annotation/json_annotation.dart';

part 'sys_health_property.g.dart';

@JsonSerializable()
class PropertyHealthModel {
  ///生病状态：0 没病; 1 易生病; 2 小病; 3 大病,
  final int illStatus;
  final List<PropertyHealthDataInfo> propertyHealthData;

  PropertyHealthModel(this.illStatus, this.propertyHealthData);

  factory PropertyHealthModel.fromJson(Map<String, dynamic> json) =>
      _$PropertyHealthModelFromJson(json);

  Map<String, dynamic> toJson() => _$PropertyHealthModelToJson(this);
}

@JsonSerializable()
class PropertyHealthDataInfo {
  final String propertyId;
  final String name;
  final String type;
  final String healthSystem;

  ///数值
  final int value;
  final String iconUrl;
  final String skillType;
  final int weightPercent;
  final String illPropertyId;

  ///疾病值
  final int illValue;
  final String illnessId;
  final String illnessName;

  ///各系统等级 0健康 1易生病 2小病 3 大病
  final int healthGrade;
  final String propose;
  final String drugName;
  final String illnessDesc;
  final String drugIcon;
  final int effectValue;

  PropertyHealthDataInfo(
      this.propertyId,
      this.name,
      this.type,
      this.value,
      this.iconUrl,
      this.skillType,
      this.weightPercent,
      this.illPropertyId,
      this.illValue,
      this.illnessId,
      this.illnessName,
      this.healthGrade,
      this.propose,
      this.healthSystem,
      this.drugName,
      this.illnessDesc,
      this.drugIcon,
      this.effectValue);

  factory PropertyHealthDataInfo.fromJson(Map<String, dynamic> json) =>
      _$PropertyHealthDataInfoFromJson(json);

  Map<String, dynamic> toJson() => _$PropertyHealthDataInfoToJson(this);
}
